package Operation;

import Book.BookList;

public class Exit implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("退出系统！");
        int ret = bookList.getUsedSize();
        for (int i = 0; i < ret; i++) {
            //将已有书籍置为空
            bookList.setBooks(i,null);
        }
        //将书籍数目置为0
        bookList.setUsedSize(0);
        //退出程序 ---  JAVA用法
        System.exit(0);
    }
}
